﻿using HotelRegistrationSystem.DAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Web;

namespace HotelRegistrationSystem.Code
{
    public class CancelReservationDeamon
    {
        // set sleep time to one day
        private readonly int sleepTime = 1000 * 60 * 60 * 24;

        public void MonitorReservations()
        {
            while (true)
            {
                ReservationsDAL.AutomaticCancel();
                Thread.Sleep(sleepTime);
            }
        }
    }
}